In [1]:
pwd
Out[1]:
'C:\\Users\\alpha\\Documents\\TestingGeopandas'
In [2]:
cd C:\Users\alpha\Documents\work\burned pixels\ecoregions_countries_climates_continents
C:\Users\alpha\Documents\work\burned pixels\ecoregions_countries_climates_continents
In [15]:
import geopandas as gpd
import matplotlib.pyplot as plt
import pickle
import pandas as pd
import numpy as np
import calendar

import matplotlib.cm as cm
import matplotlib.colors as cls
from mpl_toolkits.axes_grid1.inset_locator import inset_axes
In [4]:
#latex
import matplotlib
matplotlib.rcParams['mathtext.fontset'] = 'custom'
matplotlib.rcParams['mathtext.rm'] = 'Times New Roman'
matplotlib.rcParams['mathtext.it'] = 'Times New Roman:italic'
matplotlib.rcParams['mathtext.bf'] = 'Times New Roman:bold'

matplotlib.rcParams["text.latex.preamble"].append(r'\usepackage{faktor}')
In [16]:
clima = gpd.read_file('clima')
In [17]:
clima.columns
Out[17]:
Index(['OBJECTID', 'GRIDCODE', 'SUM_2001_J', 'SUM_2001_F', 'SUM_2001_M',
       'SUM_2001_A', 'SUM_2001_1', 'SUM_2001_2', 'SUM_2001_3', 'SUM_2001_4',
       ...
       'SUM_2017_3', 'SUM_2017_4', 'SUM_2017_S', 'SUM_2017_O', 'SUM_2017_N',
       'SUM_2017_D', 'SUM_Area', 'Shape_Leng', 'Shape_Area', 'geometry'],
      dtype='object', length=210)
In [18]:
clima['SUM_Area'].head()
Out[18]:
0    6.722216e+12
1    4.817588e+12
2    7.710235e+11
3    1.626131e+13
4    4.691048e+12
Name: SUM_Area, dtype: float64
In [19]:
data_columns = clima.columns[2:2+17*12]
In [20]:
data_columns
Out[20]:
Index(['SUM_2001_J', 'SUM_2001_F', 'SUM_2001_M', 'SUM_2001_A', 'SUM_2001_1',
       'SUM_2001_2', 'SUM_2001_3', 'SUM_2001_4', 'SUM_2001_S', 'SUM_2001_O',
       ...
       'SUM_2017_M', 'SUM_2017_A', 'SUM_2017_1', 'SUM_2017_2', 'SUM_2017_3',
       'SUM_2017_4', 'SUM_2017_S', 'SUM_2017_O', 'SUM_2017_N', 'SUM_2017_D'],
      dtype='object', length=204)
In [21]:
inter_cols = {}
for yr in range(17):
    inter_cols[yr] = data_columns[12*yr:12*yr +12]
In [22]:
area = clima['SUM_Area']*1e-6
In [23]:
intra_cols = {}
for mo in range(12):
    intra_cols[mo] = [data_columns[mo + yr *12  ] for yr in range(17)]
In [24]:
for yr in range(17):
    inter = clima[  inter_cols[yr]].sum(axis=1)/area
    label = 'inter_' + str(yr +2001)
    clima= clima.assign(label=inter)
    clima = clima.rename(columns={'label': label})
In [25]:
clima.plot(column='inter_2001', cmap='OrRd')
Out[25]:
<matplotlib.axes._subplots.AxesSubplot at 0x297bd90fa58>
In [26]:
def draw_map(df,column,title=None,vmin=0,vmax=1,name='name',dpi=100):
    fig, ax = plt.subplots(figsize=(12, 8))

    ax.set_aspect('equal')
    ax = df.plot(ax =ax, column=column, cmap='OrRd',vmin=vmin, vmax=vmax)
    ax.set_axis_off()
    
    norm = cls.Normalize(vmin, vmax)
    cmmapable = cm.ScalarMappable(norm, 'OrRd')
    
    cmmapable._A = []
    cbaxes = inset_axes(ax, width="80%", height="1%", loc=3)
    cb = plt.colorbar(cmmapable, cax=cbaxes,orientation="horizontal") 

    cb.set_label(title, fontsize=20, family='Times New Roman')
    cb.ax.set_yticklabels(cb.ax.get_yticklabels(), fontsize=15, family='Times New Roman')

    plt.show()
    fig.savefig(name, dpi=dpi, bbox_inches='tight')
In [27]:
inter_columns = clima.columns[-17:]
In [28]:
inter_max = clima[inter_columns].max().max()
In [29]:
for mo in range(12):
    intra = clima[ intra_cols[mo]].sum(axis=1)/(17*area)
    label = 'intra_{:02}'.format(mo)
    clima = clima.assign(label=intra)
    clima = clima.rename(columns={'label': label})
In [30]:
intra_columns = clima.columns[-12:]
In [31]:
intra_max = clima[intra_columns].max().max()
In [32]:
clima.plot(column='intra_01', cmap='OrRd')
Out[32]:
<matplotlib.axes._subplots.AxesSubplot at 0x297ba68fd68>
In [82]:
#draw_map(df,column,title=None,vmin=0,vmax=1,name='name',dpi=100)
column = 'intra_{:02}'.format(1)
mo_name = calendar.month_name[1+ 1]
title = r' Burned Area Pixels/$\mathrm{Km}^{2}$ by climate 2001-2017 ' + mo_name
#title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
#title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
name = 'TESTEintra_ecoregions_{}'.format(calendar.month_name[mo + 1].lower())
draw_map(clima,column,title=title,vmin=0,vmax=intra_max,name=name)
In [83]:
#draw_map(df,column,title=None,vmin=0,vmax=1,name='name',dpi=100)
column = 'inter_{}'.format(2001)
mo_name = calendar.month_name[1+ 1]
title = r' Burned Area Pixels/$\mathrm{Km}^{2}$ by climate 2001-2017 ' +'2001'
#title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
#title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
name = 'TESTEinter_ecoregions_{}'.format(2001)
draw_map(clima,column,title=title,vmin=0,vmax=inter_max,name=name)

Inter-Anual

In [84]:
%%time
for yr in range(17):
    column = 'inter_{}'.format(yr +2001)
    yr_name = str(yr +2001)
    #"Burnt area pixels (#/km2) by biome in 2001
    title = r'Burned area pixels ($\#/\mathrm{km}^{2}$) by climate in ' +yr_name
    #title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
    #title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
    name = 'inter_climas_{}'.format(yr +2001)
    draw_map(clima,column,title=title,vmin=0,vmax=inter_max,name=name)
    
Wall time: 1min 14s

Intra_Anual

In [87]:
%%time
for mo in range(12):
    column = 'intra_{:02}'.format(mo)
    mo_name = calendar.month_name[mo + 1]
    #"Burnt area pixels (#/km2) by biome in Janury (2001-2017)"
    title = r'Burned area pixels ($\#/\mathrm{km}^{2}$) by climate in ' +mo_name + ' (2001-2017)'
    #title = r' Burned Area Pixels/$\mathrm{Km}^{2}$ by climate 2001-2017 ' + mo_name
    #title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
    #title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
    name = 'intra_climas_{:02}'.format(mo)
    draw_map(clima,column,title=title,vmin=0,vmax=intra_max,name=name)
Wall time: 52.6 s
In [89]:
data_columns
Out[89]:
Index(['SUM_2001_J', 'SUM_2001_F', 'SUM_2001_M', 'SUM_2001_A', 'SUM_2001_1',
       'SUM_2001_2', 'SUM_2001_3', 'SUM_2001_4', 'SUM_2001_S', 'SUM_2001_O',
       ...
       'SUM_2017_M', 'SUM_2017_A', 'SUM_2017_1', 'SUM_2017_2', 'SUM_2017_3',
       'SUM_2017_4', 'SUM_2017_S', 'SUM_2017_O', 'SUM_2017_N', 'SUM_2017_D'],
      dtype='object', length=204)
In [155]:
total = clima[data_columns].sum(axis=1)/17
In [156]:
total = total/area
In [157]:
total.plot()
Out[157]:
<matplotlib.axes._subplots.AxesSubplot at 0x297c097dfd0>
In [158]:
clima= clima.assign(total=total)
In [102]:
clima.plot(column='total',cmap='OrRd')
Out[102]:
<matplotlib.axes._subplots.AxesSubplot at 0x1fe730b7f60>
In [103]:
total.max()
Out[103]:
0.645691857137574
In [104]:
total.min()
Out[104]:
0.0
In [105]:
clima.plot(column='total',cmap='OrRd', vmin=0,vmax=total.max())
Out[105]:
<matplotlib.axes._subplots.AxesSubplot at 0x1fe011f6b00>
In [108]:
clima.plot(column='total',cmap='OrRd', scheme='quantiles')
Out[108]:
<matplotlib.axes._subplots.AxesSubplot at 0x1fe06da3240>
In [109]:
column = 'total'
title = r' Burned Area Pixels/$\mathrm{Km}^{2}$ by climate 2001-2017 ' 
#title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
#title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
name = 'total_climas'
draw_map(clima,column,title=title,vmin=0,vmax=total.max(),name=name)
In [129]:
column = 'total'
title = r' Burned Area Pixels/$\mathrm{Km}^{2}$ by climate 2001-2017 ' 
#title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
#title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
name = 'total_climas'
draw_map(clima,column,title=title,vmin=0,vmax=total.max(),name=name)

testes

In [135]:
yr =0
column = 'inter_{}'.format(yr +2001)
yr_name = str(yr +2001)
#"Burnt area pixels (#/km2) by biome in 2001
title = r'Burned area pixels ($\#/\mathrm{km}^{2}$) by climate in ' +yr_name
#title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
#title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
name = 'inter_climas_{}'.format(yr +2001)
draw_map(clima,column,title=title,vmin=0,vmax=inter_max,name=name)
In [37]:
yr =0
column = 'inter_{}'.format(yr +2001)
yr_name = str(yr +2001)
#"Burnt area pixels (#/km2) by biome in 2001
title = r'Burned area pixels ($\#/\mathrm{km}^{2}$) by climate in ' +yr_name
#title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
#title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
name = 'inter_climas_{}'.format(yr +2001)
draw_map(clima,column,title=title,vmin=0,vmax=inter_max,name=name)
In [41]:
clima.columns[-20:]
Out[41]:
Index(['inter_2010', 'inter_2011', 'inter_2012', 'inter_2013', 'inter_2014',
       'inter_2015', 'inter_2016', 'inter_2017', 'intra_00', 'intra_01',
       'intra_02', 'intra_03', 'intra_04', 'intra_05', 'intra_06', 'intra_07',
       'intra_08', 'intra_09', 'intra_10', 'intra_11'],
      dtype='object')
In [76]:
from scipy.stats import boxcox
In [89]:
test_column = boxcox(clima.inter_2001 + 1e-25)
In [84]:
any(clima.inter_2001 + 1e-10 <=0)
Out[84]:
False
In [88]:
clima.inter_2001 + 1e-25
Out[88]:
0     5.814005e-03
1     6.289848e-02
2     8.750577e-02
3     6.195186e-01
4     4.873964e-03
5     7.242443e-02
6     4.939819e-02
7     5.064166e-01
8     6.389761e-02
9     2.438223e-02
10    5.742541e-04
11    2.781230e-02
12    1.612627e-02
13    2.160050e-03
14    2.747323e-01
15    1.995443e-01
16    4.650226e-03
17    1.332400e-01
18    3.559614e-02
19    4.370503e-03
20    4.810833e-02
21    3.761643e-02
22    1.023244e-02
23    1.312836e-02
24    9.451055e-03
25    1.612265e-02
26    6.986554e-02
27    7.488165e-03
28    4.553035e-02
29    1.000000e-25
30    1.024983e-03
Name: inter_2001, dtype: float64
In [91]:
clima.inter_2001.size
Out[91]:
31
In [98]:
test_column[0]
Out[98]:
array([-3.54995093, -2.25085379, -2.02995448, -0.46152366, -3.62846793,
       -2.15788471, -2.40549976, -0.64584037, -2.2405643 , -2.8256951 ,
       -4.42821035, -2.75079943, -3.05125968, -3.96428576, -1.17113544,
       -1.42664774, -3.64903022, -1.73184551, -2.6062177 , -3.67594846,
       -2.42208674, -2.57311077, -3.28335764, -3.15822493, -3.32224119,
       -3.05137833, -2.18179167, -3.43348504, -2.45639775, -6.46885154,
       -4.23695791])
In [ ]:
clima[inter_columns].min().min()
In [99]:
clima = clima.assign(test_column =test_column[0])
In [100]:
yr =0
column = 'test_column'
yr_name = str(yr +2001)
#"Burnt area pixels (#/km2) by biome in 2001
title = r'Burned area pixels (#/$\mathrm{km}^{2}$) by climate in ' +yr_name
#title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
#title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
name = 'teste'
draw_map(clima,column,title=title,vmin=test_column[0].min(),vmax=test_column[0].max(),name=name)
In [102]:
clima.plot(column='inter_2001',cmap='OrRd' ,scheme='quantiles')
Out[102]:
<matplotlib.axes._subplots.AxesSubplot at 0x297beecba58>
In [12]:
yr_name = '2001'
title = r'Burned area pixels ($\mathrm{\#}/\mathrm{km}^{2}$) by climate in ' +yr_name
In [13]:
plt.text(0.1,0.5,title);
In [175]:
!set PATH=%PATH%;C:\Program Files\MiKTeX 2.9\miktex\bin\x64
In [5]:
!path
PATH=C:\ProgramData\Anaconda3\envs\geopandas\lib\site-packages\shapely\DLLs;C:\ProgramData\Anaconda3\envs\geopandas\DLLs;C:\ProgramData\Anaconda3\envs\geopandas;C:\ProgramData\Anaconda3\envs\geopandas\Library\mingw-w64\bin;C:\ProgramData\Anaconda3\envs\geopandas\Library\usr\bin;C:\ProgramData\Anaconda3\envs\geopandas\Library\bin;C:\ProgramData\Anaconda3\envs\geopandas\Scripts;C:\ProgramData\Anaconda3\envs\geopandas\bin;C:\ProgramData\Anaconda3;C:\ProgramData\Anaconda3\Library\mingw-w64\bin;C:\ProgramData\Anaconda3\Library\usr\bin;C:\ProgramData\Anaconda3\Library\bin;C:\ProgramData\Anaconda3\Scripts;C:\ProgramData\Anaconda3\bin;C:\Program Files\ImageMagick-7.0.7-Q16;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\CodeBlocks\MinGW\bin;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Calibre2\;C:\Program Files (x86)\PDFtk\bin\;C:\WINDOWS\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;"C:\Program Files\MiKTeX 2.9\miktex\bin\x64";C:\ProgramData\Anaconda3\envs\geopandas\Library\bin
In [128]:
lambdas = []
for yr in range(17):
    column= 'inter_{}'.format(2001 + yr)
    test_column, lbd = boxcox(clima[column] + 1e-25)
    lambdas.append(lbd)
lmbda=  sum(lambdas)/len(lambdas)   
In [129]:
maxs = []
mins = []
for yr in range(17):
    column= 'inter_{}'.format(2001 + yr)
    test_column = boxcox(clima[column] + 1e-25,lmbda=lmbda)
    maxs.append(test_column.max())
    mins.append(test_column.min())
    
In [140]:
lambdas
Out[140]:
[0.1545658091600737,
 0.16488983981155983,
 0.17029761469254157,
 0.13840329578730226,
 0.15702301417435333,
 0.14828820919455313,
 0.14817191951646735,
 0.143685257682186,
 0.16182503023654768,
 0.13973869679605547,
 0.14911260458503575,
 0.1451664691073201,
 0.15119841570084241,
 0.16457443512399286,
 0.15022741288070038,
 0.14533870277845462,
 0.15364982658799609]
In [130]:
maxs
Out[130]:
[-0.4617899227636531,
 -0.4100616694157552,
 -0.33683114969409955,
 -0.3517038911663735,
 -0.2618293983487165,
 -0.43301548183878724,
 -0.2970343359871919,
 -0.41402508799072907,
 -0.4830766668726051,
 -0.37720649224259545,
 -0.45546232700361927,
 -0.4281520874920677,
 -0.5257913516905404,
 -0.5213370722932413,
 -0.4967237468078802,
 -0.4491959959525003,
 -0.5379210812874616]
In [132]:
mins
Out[132]:
[-6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491,
 -6.572427048117491]
In [133]:
box_min = min(mins)
box_delta =max(maxs) - box_min
In [136]:
test_column = (boxcox(clima.inter_2001 + 1e-25,lmbda=lmbda) - box_min)/box_delta
In [137]:
test_column
Out[137]:
array([0.47587265, 0.68369189, 0.71891905, 0.96831354, 0.46327068,
       0.69852128, 0.65901302, 0.93906477, 0.68533341, 0.59188035,
       0.3345674 , 0.60385465, 0.55579334, 0.40930789, 0.85562514,
       0.81499225, 0.45996953, 0.76641535, 0.62695964, 0.4556474 ,
       0.65636515, 0.63224838, 0.51862179, 0.53866748, 0.51239031,
       0.55577435, 0.69470839, 0.49455561, 0.65088735, 0.        ,
       0.36540848])
In [138]:
clima = clima.assign(test_column =test_column)
In [139]:
yr =0
column = 'test_column'
yr_name = str(yr +2001)
#"Burnt area pixels (#/km2) by biome in 2001
title = r'Burned area pixels (#/$\mathrm{km}^{2}$) by climate in ' +yr_name
#title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
#title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
name = 'teste'
draw_map(clima,column,title=title,vmin=0,vmax=1,name=name)

com a aldrabice de deslocar o x uma unidade resulta algo semelhante a não transformar nada

Inter-anual

In [141]:
for yr in range(17):
    column = 'inter_{}'.format(yr +2001)
    test_column = (boxcox(clima[column] + 1e-25,lmbda=lmbda) - box_min)/box_delta
    clima = clima.assign(test_column =test_column)
    yr_name = str(yr +2001)
    #"Burnt area pixels (#/km2) by biome in 2001
    title = r'Burned area index (#/$\mathrm{km}^{2}$) by climate in ' +yr_name
    #title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
    #title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
    name = 'inter_climas_index_{}'.format(yr +2001)
    draw_map(clima,'test_column',title=title,vmin=0,vmax=1,name=name)

Intra-anual

In [142]:
lambdas = []
for mo in range(12):
    column= 'intra_{:02}'.format(mo)
    test_column, lbd = boxcox(clima[column] + 1e-25)
    lambdas.append(lbd)
lmbda=  sum(lambdas)/len(lambdas)   
In [143]:
lambdas
Out[143]:
[0.08705966710156461,
 0.09630957693143974,
 0.10689906296799147,
 0.14076351064057047,
 0.14428087052094934,
 0.14527433765028192,
 0.14364044372672571,
 0.1539021213200582,
 0.1504818565583464,
 0.12946457638242193,
 0.10027351314731253,
 0.09009982338030267]
In [144]:
lmbda
Out[144]:
0.12403744669399708

agora os lambdas estão longe de ser tão próximos o que traduz que a variação intra-anual é mais acentuada

In [145]:
maxs = []
mins = []
for mo in range(12):
    column= 'intra_{:02}'.format(mo)
    test_column = boxcox(clima[column] + 1e-25,lmbda=lmbda)
    maxs.append(test_column.max())
    mins.append(test_column.min())
In [146]:
box_min = min(mins)
box_delta =max(maxs) - box_min
In [153]:
for mo in range(12):
    column = 'intra_{:02}'.format(mo)
    test_column = (boxcox(clima[column] + 1e-25,lmbda=lmbda) - box_min)/box_delta
    clima = clima.assign(test_column =test_column)
    mo_name = calendar.month_name[mo + 1]
    #"Burnt area pixels (#/km2) by biome in Janury (2001-2017)"
    title = r'Burned area index (#/$\mathrm{km}^{2}$) by climate in ' +mo_name + ' (2001-2017)'
    #title = r' Burned Area Pixels/$\mathrm{Km}^{2}$ by climate 2001-2017 ' + mo_name
    #title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
    #title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
    name = 'intra_climas_index_{:02}'.format(mo)
    draw_map(clima,'test_column',title=title,vmin=0,vmax=1,name=name)
In [149]:
clima[column]
Out[149]:
0     0.000587
1     0.010060
2     0.004535
3     0.105092
4     0.000133
5     0.003189
6     0.001243
7     0.044456
8     0.002345
9     0.001284
10    0.000224
11    0.000469
12    0.001549
13    0.000690
14    0.001546
15    0.001152
16    0.000135
17    0.000021
18    0.000023
19    0.000004
20    0.000000
21    0.000084
22    0.000032
23    0.000002
24    0.000000
25    0.000203
26    0.000154
27    0.000004
28    0.000000
29    0.000000
30    0.000009
Name: intra_11, dtype: float64
In [150]:
lmbda
Out[150]:
0.12403744669399708
In [152]:
(boxcox(clima[column] + 1e-25,lmbda=lmbda) - box_min)/box_delta
Out[152]:
array([0.52502391, 0.74722814, 0.67681472, 1.        , 0.43653648,
       0.64784931, 0.57625979, 0.89867587, 0.62356992, 0.57858602,
       0.46572777, 0.51047057, 0.59227465, 0.53564899, 0.5921034 ,
       0.57084844, 0.43747064, 0.34639495, 0.3502584 , 0.28355385,
       0.        , 0.41234833, 0.36511998, 0.25445494, 0.        ,
       0.46016598, 0.44439901, 0.28468435, 0.        , 0.        ,
       0.31161314])
In [159]:
column = 'total'
test_column, lbd = boxcox(clima[column] + 1e-25)
test_column = (test_column - test_column.min())/(test_column.max() - test_column.min())
clima = clima.assign(test_column =test_column)
title = r'Burned area index (#/$\mathrm{km}^{2}$) by climate in (2001-2017)' 
#title = r'Burned Area Pixels/$\mathrm{Km}^{2}$ by Climate 2001-2017 {} '.format(calendar.month_name[mo + 1])
#title =(r'ABC123 vs $\mathrm{ABC123}^{123}$')
name = 'total_climas_index'
draw_map(clima,'test_column',title=title,vmin=0,vmax=1,name=name)
In [163]:
from scipy.stats import probplot, norm
In [168]:
probplot(clima.intra_11, dist=norm, plot=plt.gca());
In [169]:
probplot(clima.test_column, dist=norm, plot=plt.gca());